﻿using Microsoft.BizTalk.Message.Interop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AppFx.BizTalk.Dynamics.CRM.Helpers.CRMDataExtract
{
    public class DefaultFetchXmlManipulator : IFetchXmlManipulator
    {
        public string ManipulateFetchXml(string fetchXml, IBaseMessage msg)
        {
            var sb = new StringBuilder(fetchXml);
            sb.Replace("$(DateTime-yyyyMM)", DateTime.Now.ToString("yyyyMM"));
            sb.Replace("$(DateTime-yyyyMMdd)", DateTime.Now.ToString("yyyyMMdd"));
            return sb.ToString();
        }
    }
}
